package s2elinshu;

import java.lang.ProcessBuilder.Redirect;

public class J12Fan {

	public static void main(String[] args) {
		Fan yellow = new Fan();
		Fan blue = new Fan();

		yellow.radius = 10;
		yellow.color = "yellow";
		yellow.speed = yellow.FAST; // 주의!!
		yellow.on = true;
		yellow.toString();
		System.out.println(yellow.toString());

		blue.radius = 5;
		blue.color = "blue";
		blue.speed = blue.MEDIUM; // 주의!!
		blue.on = false;
		blue.toString();
		System.out.println(blue.toString());

	} // main 닫음
} // J12Fan class 닫음

class Fan {
	final int SLOW = 1;
	final int MEDIUM = 2;
	final int FAST = 3;
	int speed = SLOW;
	boolean on = false;
	double radius = 5.0;
	String color = "blue";

	@Override
	// 부모 클래스에서 정의된 메서드를 자손 클래스에서 다시 정의 함
	public String toString() {
		String result = "";
		if (on == false) {
			result += speed + "/" + color + "/" + radius + "/" + "중지";
		} else {
			result += speed + "/" + color + "/" + radius + "/" + "작동중";
		}
		return result;
	}

} // Fan class 닫음